home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / ptv1n2.arc / TESTDUMP.BAS < prev    next >
BASIC Source File  |  1990-06-14  |  1KB  |  60 lines

  1. DECLARE SUB VarDump (Device$, Target AS ANY, ItSize AS INTEGER)
  2. TYPE TestIt
  3.    anInt AS INTEGER
  4.    aLong AS LONG
  5.    aSingle AS SINGLE
  6.    aDouble AS DOUBLE
  7.    ALine AS STRING * 16
  8. END TYPE
  9.  
  10. TYPE Test2
  11.    a AS INTEGER
  12.    b AS DOUBLE
  13.    c AS STRING * 2
  14. END TYPE
  15.  
  16. DIM TestVar AS TestIt
  17. DIM SecondTest AS Test2
  18. DIM TestVar2 AS TestIt
  19. CLS
  20.  
  21. TestVar.ALine = "This is a test"
  22. TestVar.anInt = 128
  23. TestVar.aLong = 32000
  24. TestVar.aSingle = 5.35
  25. TestVar.aDouble = 653.35
  26.  
  27. TestVar2.ALine = "This is a test\\"
  28. TestVar2.anInt = 128
  29. TestVar2.aLong = 32000
  30. TestVar2.aSingle = 5.35
  31. TestVar2.aDouble = 653.35
  32.  
  33. SecondTest.c = "ab"
  34. SecondTest.a = 1
  35. SecondTest.b = 4
  36.  
  37. CALL VarDump("SCRN:", VARPTR(SecondTest), LEN(SecondTest))
  38.  
  39. CALL VarDump("SCRN:", VARPTR(TestVar), LEN(TestVar))
  40.  
  41. CALL VarDump("SCRN:", VARPTR(TestVar2), LEN(TestVar2))
  42.  
  43. PRINT "Press any key"
  44. DO
  45.    a$ = INKEY$
  46. LOOP UNTIL a$ <> ""
  47.  
  48. Test$ = "This is a test of looking at strings!"
  49. CALL VarDump("SCRN:", VARPTR(Test$), 4)
  50. CALL VarDump("SCRN:", SADD(Test$), LEN(Test$))
  51.  
  52. PRINT "Press any key"
  53. DO
  54.    a$ = INKEY$
  55. LOOP UNTIL a$ <> ""
  56.  
  57. Test% = 5
  58. CALL VarDump("SCRN:", VARPTR(Test%), 2)
  59.  
  60.